
# 输入:
# 1 2 3
# 输出:
# (1, 2, 3)
# (1, 3, 2)
# (2, 1, 3)
# (2, 3, 1)
# (3, 1, 2)
# (3, 2, 1)
# '''

#method one
# import itertools
# n = list(map(int, input().split()))
# my_list = list(itertools.permutations(n))
# for item in my_list:
#     print(item)


#method 2
nums = list(map(int, input().split()))
res = []

def backtrack(nums, tmp):
    if not nums:
        res.append(tmp)
    for i in range(len(nums)):
        backtrack(nums[:i] + nums[i+1:], tmp + [nums[i]])

backtrack(nums, [])
print(res)
